<?php

 /**
  * @package JooS
  * @subpackage Syntax
  */

  require_once "JooS/Syntax/Complex/Transition.php";

 /**
  * String ::= "'" , { "\'" | Any - "'" } , "'" | '"' , { '\"' | Any - '"' } , '"';
  **/
  class JooS_Syntax_Common_String extends JooS_Syntax_Complex_Transition {
    /**
     * @return JooS_Syntax_Complex_Choose
     */
    protected function createRule() {
      return $this->createSyntax("Complex_Choose", array(
        $this->createSyntax("Complex_Concatenate", array(
          $this->createSyntax("Simple_Symbol", "'"), 
          $this->createSyntax("Complex_Repetition", $this->createSyntax("Complex_Choose", array(
            $this->createSyntax("Simple_Symbol", "\\'"), 
            $this->createSyntax("Except", $this->createSyntax("Simple_Any"), $this->createSyntax("Simple_Symbol", "'"))
          ))), 
          $this->createSyntax("Simple_Symbol", "'")
        )), 
        $this->createSyntax("Complex_Concatenate", array(
          $this->createSyntax("Simple_Symbol", "\""), 
          $this->createSyntax("Complex_Repetition", $this->createSyntax("Complex_Choose", array(
            $this->createSyntax("Simple_Symbol", "\\\""), 
            $this->createSyntax("Except", $this->createSyntax("Simple_Any"), $this->createSyntax("Simple_Symbol", "\""))
          ))), 
          $this->createSyntax("Simple_Symbol", "\""), 
        ))
      ));
    }
  }
